package com.sean.controller;

import com.sean.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello() {
        return "hello swagger";
    }

    @PostMapping("/user")
    public User user() {
        return new User();
    }

    @ApiOperation("Post测试类")
    @PostMapping("/postt")
    public User postt(@ApiParam("用户") User user) {
        int i = 5 / 0;
        return user;
    }
}
